package com.firewolf.vue.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作者：刘兴
 * 时间:19/3/7
 **/
@RestController
@RequestMapping("/dept")
public class DeptController {

    @PreAuthorize("hasAuthority('sys:dept:list')") //hasAuthority('sys:dept:list') and hasRole()"
    @GetMapping("/list")
    public String list(){
        return "list";
    }

    @PreAuthorize("hasAuthority('sys:dept:add')")
    @GetMapping("/add")
    public String add(){
        return "add";
    }


    @PreAuthorize("hasAuthority('sys:dept:delete')")
    @GetMapping("/delete")
    public String delete(){
        return "delete";
    }


    @PreAuthorize("hasAuthority('sys:dept:update')")
    @GetMapping("/update")
    public String update(){
        return "update";
    }
}
